<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>编译作用域</title>
</head>
<body>
  <div id="app">
    {{info}}
    这里的isShow看的是vue里面的data
    <cpn v-show="isShow"></cpn> 
  </div>

  <template id="cpn">
    <div>
      <h2>标题</h2>
      <p>我是子组件</p>
    </div>
  </template>

  <script src="../js/vue.js"></script>
  <script>
    const app = new Vue({
      el: '#app',
      data: {
        info: '你好啊',
        isShow: true   //用的这个！！
      },
      components: {  //注册组件
        cpn: {
          template: '#cpn',
          data() {
            return {
              isShow: false
            }
          }
        }
      }
    })
  </script>
</body>
</html>